<template>
  <div style="margin: 50px;">
    <el-row :gutter="10">
      <el-col v-if="activeName == 'all'" :span="8">
        <el-card class="box-card">
          <!-- 垂直居中-->
          <div style="height: 100%;width: 100%; display: flex;justify-content: center;  align-items: center;">
            <el-button type="text" @click="$emit('openAdd')">
              <i class="el-icon-circle-plus-outline" style="font-size: 70px;" />
            </el-button>
          </div>
        </el-card>
      </el-col>
      <el-col v-for=" (taskItem) in tasks" :key="taskItem.id" :span="8">
        <TaskItemVue
          :task-item="taskItem"
          @publish="$emit('publish', $event)"
          @editTask="$emit('editTask', $event)"
          @preview="$emit('preview', $event)"
          @handleCommand="$emit('handleCommand', $event)"
        />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import TaskItemVue from './TaskItem.vue'

export default {
  components: { TaskItemVue },
  props: {
    activeName: {
      type: String,
      default: 'all'
    },
    tasks: {
      type: Array,
      default: () => []
    }
  }
}
</script>
